
var session = require('../common/session');
var that;
Component({
  data: {
    show: true,
    selected: 0,
    color: "#333333",
    selectedColor: "#333333",
    dashboardSelected: true,
    mySelected: false,
    list: [{
      pagePath: "/pages/dashboard/dashboard",
      iconPath: "../images/dashboard.png",
      selectedIconPath: "../images/dashboardSelect.png",
      text: "工作台"
    }, {
      pagePath: "/pages/my/my",
      iconPath: "../images/my.png",
      selectedIconPath: "../images/mySelect.png",
      text: "我的"
    }]
  },
  attached:function() {

  },
  methods: {
    switchTab(e) {
      var data = e.currentTarget.dataset;
      const url = data.path;
      if(this.data.selected != data.index){
        wx.switchTab({url});
        this.setData({
          selected: data.index
        });
        
      }
    }
  }
})